<template>
  <el-dialog title="查看详情" v-model="dialogVisible" width="500">
    <el-descriptions border :column="1" title="策略详情">
      <el-descriptions-item label="id">{{ data.id }}</el-descriptions-item>
      <el-descriptions-item label="策略类型">
        {{ data.strategyType }}
      </el-descriptions-item>
      <el-descriptions-item label="策略名称">
        {{ data.strategyName }}
      </el-descriptions-item>
      <el-descriptions-item label="策略触发条件">
        {{ data.strategyTriggerCondition }}
      </el-descriptions-item>
      <el-descriptions-item label="策略触发关键字">
        {{ data.keyword }}
      </el-descriptions-item>
      <el-descriptions-item label="多少次触发">
        {{ data.keywordCount }}
      </el-descriptions-item>
      <el-descriptions-item label="机器人提示语">
        {{ data.prompt }}
      </el-descriptions-item>
      <el-descriptions-item label="创建时间">
        {{
          data.createTime &&
          dayjs(data.createTime).format('YYYY-MM-DD HH:mm:ss')
        }}
      </el-descriptions-item>
      <el-descriptions-item label="修改时间">
        {{
          data.updateTime &&
          dayjs(data.updateTime).format('YYYY-MM-DD HH:mm:ss')
        }}
      </el-descriptions-item>
      <el-descriptions-item label="版本">
        {{ data.version }}
      </el-descriptions-item>
      <el-descriptions-item label="修改人id">
        {{ data.updateId }}
      </el-descriptions-item>
      <el-descriptions-item label="策略名称">
        {{ data.strategyName }}
      </el-descriptions-item>
    </el-descriptions>
  </el-dialog>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import dayjs from 'dayjs'

const dialogVisible = ref(false)
const data = ref()

const open = (row: any) => {
  data.value = row
  dialogVisible.value = true
}

defineExpose({ open })
</script>

<style scoped></style>
